"""Definition of the Research Achievement content type
"""

from zope.interface import implements

try:
    from Products.LinguaPlone import public as atp
except ImportError:
    # No multilingual support
    from Products.Archetypes import atapi as atp
from Products.ATContentTypes.content import base
from Products.ATContentTypes.content import schemata

# -*- Message Factory Imported Here -*-
from Products.ATContentTypes.content import newsitem
from my315ok.researchevent.interfaces import IResearchAchievement
from my315ok.researchevent.config import PROJECTNAME

ResearchAchievementSchema = newsitem.ATNewsItemSchema.copy() + atp.Schema((

    # -*- Your Archetypes field definitions here ... -*-

))

# Set storage on fields copied from ATContentTypeSchema, making sure
# they work well with the python bridge properties.

ResearchAchievementSchema['title'].storage = atp.AnnotationStorage()
ResearchAchievementSchema['description'].storage = atp.AnnotationStorage()

schemata.finalizeATCTSchema(ResearchAchievementSchema, moveDiscussion=False)


class ResearchAchievement(newsitem.ATNewsItem):
    """a scientific research achievement for research event"""
    implements(IResearchAchievement)

    meta_type = "ResearchAchievement"
    schema = ResearchAchievementSchema

    title = atp.ATFieldProperty('title')
    description = atp.ATFieldProperty('description')

    # -*- Your ATSchema to Python Property Bridges Here ... -*-

atp.registerType(ResearchAchievement, PROJECTNAME)
